/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package east2west.service;

import east2west.dao.CarOrderDAO;
import east2west.dto.CarOrderDTO;
import east2west.dto.CarOrderDetailDTO;
import east2west.dto.CustomerDTO;
import java.util.ArrayList;

/**
 *
 * @author anhtuan
 */
public class CarOrderService {

    CarOrderDAO dao = new CarOrderDAO();

    public int create(CarOrderDTO dto) {
        return dao.create(dto);
    }

    public boolean insertOrder(ArrayList<CarOrderDetailDTO> cart, CarOrderDTO carOrder, CustomerDTO customer) {
        CarOrderService serCar = new CarOrderService();
        CustomerService serCus = new CustomerService();
        CarOrderDetailService serDetail = new CarOrderDetailService();

        return false;
    }

    public CarOrderDTO findById(int code) {
        return dao.findById(code);
    }

    public ArrayList<CarOrderDTO> readOrder() {
        return dao.readByAll();
    }

    public boolean accept(int id) {
        return dao.update(id);
    }

    public boolean delete(int id) {
        return dao.delete(id);
    }
}
